<!-- 查票 -->
<?php
include "../../inc/log/adsession.php";
// include "../../inc/data/connAdmin.php";
?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>课程查询过程</title>
</head>
<body>
	<?php
	include "../../inc/data/connAdmin.php";
	  
  $sql="select cocode,coname,coweekh,coweek,cotype,cograde,majorname,taskid,taskterm,tasktime,taskroom,classname,tename,mamx_teacher.teid
        from mamx_course,mamx_task,mamx_teacher
        where mamx_task.coid=mamx_course.coid
        and mamx_task.teid=mamx_teacher.teid
        and taskterm=? and mamx_course.majorname=?";
  $stmt=$conn->prepare($sql);
  $stmt->bind_param("is",$taskTerm,$majorName);
  $str=$_GET['q'];
  $taskTerm=substr($str, 0,6);
  $majorName=substr($str, 6); 
  $stmt->execute();
  $stmt->bind_result($cCode,$cName,$cWeekh,$cWeek,$cType,$cGrade,$majorName,$taskId,$taskTerm,$taskTime,$taskRoom,$stuClass,$teName,$teId);
  $stmt->store_result();
	// echo "$str";
  if ($stmt->num_rows > 0){
?>
<center>
<table border="1" id="table" style="width:75%;border:4px solid #1D50A2;text-align:center">
    <tr style="font-size:25px;font-weight:bold;color:#43a85e">
        <td>授课教师工号</td>
        <td>授课教师姓名</td>
        <td>课程编码</td>
        <td>课程名称</td>
        <td>适用年级</td>
        <td>适用专业</td>
        <td>学年学期</td>
        <td>班级</td>
        <td>授课时间</td>
        <td>授课地点</td>
        <td>操作</td>
    </tr>
<?php
      while ($stmt->fetch()){
        echo <<<END
          <tr style="font-size:18px">
            <td>$teId</td>
            <td>$teName</td>
            <td>$cCode</td>
            <td>$cName</td>
            <td>$cGrade</td>
            <td>$majorName</td>
            <td>$taskTerm</td>
            <td>$stuClass</td>
            <td>$taskTime</td>
            <td>$taskRoom</td>
            <td>
              <a href="" onclick="if(confirm('确定要删除该教学任务吗?')) 
                location='taskDel.php?taskid=$taskId'" style="color:#f79b28;font-weight:bold">删除</a> / 
              <a href="taskModi.php?taskid=$taskId" style="text-decoration: none;color:#287bf7;font-weight:bold">修改</a>
            </td>
          </tr>
END;
      }
      ?>
    </table>
 </center>
   <?php
    }
    else{
      echo"暂时没有课程记录！" ;
    } 
    ?>
</body>
</html>